<!DOCTYPE html>
<html>
<head>
    <title>益多多回收</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
    <style type="text/css">
		body,html{background: #e4e4e4;}
		.xyg-search{width: 96%; height: auto; padding: 0px 2%; background:#09C15F;}
	  .xyg-search .xyg-search-left{width:30%; height:100px;line-height:100px; text-align:center;color: #ffffff;float: left;}
	  .xyg-search .xyg-search-right{width:70%; height: 100px;float: left;}
	   .xyg-search .xyg-search-right .xyg-search-right-content{width:90%; height:70px;border-radius: 15px; margin:15px; background: #ffffff;}
	  .xyg-search-right-content-icon{width: 5%; float: left; text-align: center; height: 60px; padding:10px 5% 5px 2%;}
	  .xyg-search .xyg-search-right input{width:85%;height: 70px;border-radius: 15px;line-height:70px;background-color: transparent; font-size:28px;color: #999999;border: 0;background: #ffffff;float: left; padding-left:3%;}
	  
	.xyg-list{width:96%;height:auto; margin:0.5rem 2%;}
  	.xyg-list .xyg-list-item{width:98%;height:260px;padding:0.5rem 1%; margin-bottom:0.5rem; background:#ffffff;border-radius:10px; }
  	.xyg-list .xyg-list-item .xyg-list-item-pic{width:35%;height:260px; float:left;}
	.xyg-list .xyg-list-item .xyg-list-item-pic img{width:auto;height:260px; margin:0px auto; max-width:96%;}
	.xyg-list .xyg-list-item .xyg-list-item-content{width:63%;height:260px; margin-left:2%; float:left;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-title{width:100%;height:60px; font-size:32px; font-weight:bold; color:#000;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-line{width:100%;height:50px; line-height:50px; font-size:28px;color:#999;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-btn{width:100%;height:50px;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-btn .xyg-list-item-content-btn-title{width:160px;height:50px;line-height:50px; font-size:28px; color:#09C15F; border-radius:20px; text-align:center; border:1px solid #09C15F;float: right; margin-right:1rem;}
    </style>
</head>
<body>
  <div class="xyg-search">
	  <div class="xyg-search-left">
	  	<span><svg class="icon_fff_2" aria-hidden="true"><use xlink:href="#icondizhi1"></use></svg></span>
        <span id="area" >全部</span>
        <span><svg class="icon_fff" aria-hidden="true"><use xlink:href="#iconxiangxia"></use></svg></span>
	  </div>
	  <div class="xyg-search-right">
	  	<div class="xyg-search-right-content">
	  		<input type="text" id="companyName" placeholder="请输入公司名称" />
            <div class="xyg-search-right-content-icon" id="searchBtn" >
	  			<svg class="icon" aria-hidden="true">
                    <use xlink:href="#iconsousuo">
                    </use>
                </svg>
	  		</div>
	  		<div class="clearBoth"></div>
	  	</div>
	  </div>
	  <div class="clearBoth"></div>
  </div>
<!--左右菜单导航三开始-->
  <!--<div class="wrapper xyg-comp-menu-three-left-right" id="retr">
	  <div class="scroller">
		  <ul class="clearfix">
			  <li style="margin-left: 0px; margin-right: 0px;" class="cur">
			  	<a href="javascript:void(0)">所有礼品</a>
			  </li>
			 <li style="margin-left: 0px; margin-right: 0px;">
				<a href="javascript:void(0)">数码家电</a>
			 </li>
			   <li style="margin-left: 0px; margin-right: 0px;">
				<a href="javascript:void(0)">日常家居</a>
			 </li>
			   <li style="margin-left: 0px; margin-right: 0px;">
				<a href="javascript:void(0)">美妆</a>
			 </li>
			   <li style="margin-left: 0px; margin-right: 0px;">
				<a href="javascript:void(0)">洗护</a>
			 </li>
		  </ul>
	  </div>
  </div>-->
  <!--左右菜单导航三结束-->

<div class="xyg-list" id="showList">

</div>

<div class="xyg-product-list_loadmore weui-loadmore clearBoth">
  <i class="weui-loading"></i>
  <span class="weui-loadmore__tips">正在加载</span>
</div>

</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/js/iscroll.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/js/component.js"></script>
<script src="${s.base}/mobile/js/base.js"></script>


<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
       $('.wrapper').navbarscroll();
       $("#searchBtn").bind("click",function () {
           companyName = $("#companyName").val();
           console.log(area)
           $("#showList").html("");
           pageStart=0;
           initPage();
           sendPost();
       });
    });
    var memberId = '${memberId}';
    var area = "";
    var companyName = "";
    // 所在区域
    var items=[{
        title: "全部",
        value: "",
    }];
    $.ajax({
        type:"post",
        url:"/phone/webAddressJsonList",
        data:"",
        async:false,
        success:function (data) {
            if(data.code=="0"){
                var webAddressList = data.data;
                if(webAddressList != null && webAddressList.length > 0){
                    for (var i=0;i<webAddressList.length;i++){
                        var webAddress=webAddressList[i];
                        var obj={};
                        obj.title=webAddress.area;
                        obj.value = webAddress.id;
                        items.push(obj);
                    }
                }else{
                    // $("#show").show();
                    return false;
                }
            }else{
                layer.msg(data.msg);
            }
        }
    })
    $("#area").select({
        title: "请选择",
        // multi: true,
        min: 2,
        max: 3,
        items: items,
        onChange: function(d) {
            if (d != null && d.data != null && d.data.titles != null &&
                d.data.titles != "" && d.data.titles != undefined && d.data.titles != "undefined") {
                pageStart=0;
                area=d.data.value;
                initPage();
                sendPost();
            }
        },
        onClose: function (d) {
            $("#area").html(d.data.titles)
            area = d.data.values;
            //console.log('close')
        },
        onClick: function (d) {
            //console.log(1)
        }
    });

    var pageStart=0;
    var num=10;
    var loading = false;  //状态标记
    sendPost();
    $(document).ready(function(e) {
        initPage();
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            sendPost();
        });
    });

    function initPage() {
        $(document.body).infinite();
        $(".xyg-product-list_loadmore").show();
    }

    function sendPost() {
        $("#showContent").hide();
        pageStart++;
        $.post("/phone/recoveryCircleJsonList",{
            pageSize : num,
            pageNum : pageStart,
            area:area,
            companyName:companyName,
            status:'2',
            removeTag:"1"
        },function(resultInfo){
            if (resultInfo.data!=null && resultInfo.data.length > 0){
                for(var j=0;j<resultInfo.data.length;j++){
                    var recoveryCircle = resultInfo.data[j];
                    var image = recoveryCircle.image;
                    var imageC = "${s.base}/mobile/images/pic/pic2.png";
                    if (image != null && image != "") {
                        imageC = image.split(",")[0];
                    }
                    //添加订单第一个商品
                    // 图片取第一张
                    var str='<div class="xyg-list-item">\
                        <div class="xyg-list-item-pic">\
                        <img src="'+imageC+'" style="width: 96%; height: 100%;" /></div>\
                        <div class="xyg-list-item-content">\
                        <div class="xyg-list-item-content-title font-grade-one">'+recoveryCircle.companyName+'</div>\
                    <div class="xyg-list-item-content-line">所在区域：'+recoveryCircle.areaName+'</div>\
                    <div class="xyg-list-item-content-line">经营范围：'+recoveryCircle.businessScope+'</div>\
                    <div class="xyg-list-item-content-line">联系人：'+recoveryCircle.name+'</div>\
                    <div class="xyg-list-item-content-btn">\
                        <div class="xyg-list-item-content-btn-title" onclick="goRecoveryCircleShowPage(\''+memberId+'\',\''+recoveryCircle.id+'\')">查看商户</div></div>\
                    </div>\
                    <div class="clearBoth"></div>\
                        </div>';


                    $("#showList").append(str);
                    loading = false;
                    if(!resultInfo.hasNextPage){
                        $(document.body).destroyInfinite();
                        $(".xyg-product-list_loadmore").hide();
                    }
                }
            }else{
                $(document.body).destroyInfinite();
                $(".xyg-product-list_loadmore").hide();
                // $("#showContent").show();
            }

        },"json");
    }
</script>
</html>
